//
//  HomeTableHeaderView.m
//  NuwaRobot
//
//  Created by Kendama on 2017/12/4.
//  Copyright © 2017年 Kendama. All rights reserved.
//

#import "HomeTableHeaderView.h"

@implementation HomeTableHeaderView

- (UIImageView *)iconImageView
{
    if(!_iconImageView)
    {
        UIView *superView = self;
        _iconImageView = [[UIImageView alloc]init];
        [superView addSubview:_iconImageView];
        _iconImageView.image = [UIImage imageNamed:@"icon_facility"];
    }
    return _iconImageView;
}
- (UILabel *)titleLabel
{
    if(!_titleLabel)
    {
        UIView *superView = self;
        _titleLabel = [[UILabel alloc]init];
        [superView addSubview:_titleLabel];
        [_titleLabel setFont:fontWithSize(13)];
        [_titleLabel setTextColor:rgba(136,159,208,1)];
        _titleLabel.text = @"已添加设备";
    }
    return _titleLabel;
}


- (void)masLayoutSubview
{
    __weak UIView *superView = self;
    
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(superView.mas_centerY);
        make.left.mas_equalTo(superView.mas_left);
        make.height.width.mas_equalTo(px1920Height(30));
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(superView.mas_centerY);
        make.left.mas_equalTo(self.iconImageView.mas_right).with.offset(px1080Width(20));
        make.right.mas_equalTo(superView.mas_right);
    }];
}


@end
